package org.tysite.tyservice.example.validation.controller;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tysite.tyservice.example.validation.dto.UserInfoDemoDTO;

/**
 * 演示 spring validation 参数验证功能的API入口
 * @author tysite
 * @date 2020/3/4 0004 22:25
 */
@RestController
@RequestMapping("/api/example/validation")
public class ValidationController {

    @PostMapping("")
    public UserInfoDemoDTO validationDemo(@Validated() @RequestBody UserInfoDemoDTO dto) {
        return dto;
    }
    
    
}
